<?php
// +----------------------------------------------------------------------
// | saiadmin [ saiadmin快速开发框架 ]
// +----------------------------------------------------------------------
// | Author: your name
// +----------------------------------------------------------------------
namespace app\WechatUser\validate;

use think\Validate;

/**
 * 用户列表验证器
 */
class ebWechatUserValidate extends Validate
{
    /**
     * 定义验证规则
     */
    protected $rule =   [
        'supply_weight' => 'require|number|min:0',
        'requirement_weight' => 'require|number|min:0',
        'browsing_weight' => 'require|number|min:0',
        'collection_weight' => 'require|number|min:0',
        'docking_eight' => 'require|number|min:0',
    ];

    /**
     * 定义错误信息
     */
    protected $message  =   [
        'supply_weight.require' => '供应权重必须填写',
        'requirement_weight.require' => '需求权重必须填写',
        'browsing_weight.require' => '浏览权重必须填写',
        'collection_weight.require' => '收藏权重必须填写',
        'docking_eight.require' => '对接权重必须填写',
        'docking_eight.number' => '对接权重必须是数字',
        'docking_eight.min' => '对接权重必须大于等于0',
        'supply_weight.number' => '供应权重必须是数字',
        'supply_weight.min' => '供应权重必须大于等于0',
        'requirement_weight.number' => '需求权重必须是数字',
        'requirement_weight.min' => '需求权重必须大于等于0',
        'browsing_weight.number' => '浏览权重必须是数字',
        'browsing_weight.min' => '浏览权重必须大于等于0',
        'collection_weight.number' => '收藏权重必须是数字',
        'collection_weight.min' => '收藏权重必须大于等于0',
    ];

    /**
     * 定义场景
     */
    protected $scene = [
        'save' => [
            'supply_weight',
            'requirement_weight',
            'browsing_weight',
            'collection_weight',
            'docking_eight',
        ],
        'update' => [
            'supply_weight',
            'requirement_weight',
            'browsing_weight',
            'collection_weight',
            'docking_eight',
        ],
    ];

}
